package com.yichen.rent.controller;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.yichen.rent.response.AreaResonse;
import com.yichen.rent.response.CaseCadeAreaResponse;
import com.yichen.rent.response.Districts;
import com.yichen.rent.service.AreaService;
import entity.Result;
import entity.StatusCode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/area")
public class AreaController {

    @Autowired
    private AreaService areaService;

    /*@GetMapping()
    public Result areaResult(@PathVariable("name") String name) {
        AreaResonse areaResonse = areaService.cityInfo(name);
        String center = areaResonse.getDistricts().get(0).getCenter();
        String[] split = center.split(",");
        Map<String,String> map = new HashMap<>();
        map.put("lng",split[0]);
        map.put("lat",split[1]);
        return new Result(true, StatusCode.OK,"查询成功",map);
    }*/
}
